package com.tanhua.autoconfig.properties;

import com.baidu.aip.face.AipFace;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * 人脸识别配置文件
 */

@Data
@ConfigurationProperties(prefix = "tanhua.aip")
public class AipProperties {
    private String AppID;
    private String APIKey;
    private String SecretKey;

    @Bean
    public AipFace aipFace() {
        AipFace client = new AipFace(AppID, APIKey, SecretKey);

        // 可选：设置网络连接参数
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);

        return client;
    }

}
